package cn.classyex.business.hr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.classyex.business.hr.mapper.PerformanceMapper;
import cn.classyex.business.hr.domain.Performance;
import cn.classyex.business.hr.service.IPerformanceService;
import com.ruoyi.common.core.text.Convert;

/**
 * 绩效管理Service业务层处理
 * 
 * @author yex
 * @date 2021-05-06
 */
@Service
public class PerformanceServiceImpl implements IPerformanceService 
{
    @Autowired
    private PerformanceMapper performanceMapper;

    /**
     * 查询绩效管理
     * 
     * @param performanceId 绩效管理ID
     * @return 绩效管理
     */
    @Override
    public Performance selectPerformanceById(Long performanceId)
    {
        return performanceMapper.selectPerformanceById(performanceId);
    }

    /**
     * 查询绩效管理列表
     * 
     * @param performance 绩效管理
     * @return 绩效管理
     */
    @Override
    public List<Performance> selectPerformanceList(Performance performance)
    {
        return performanceMapper.selectPerformanceList(performance);
    }

    /**
     * 新增绩效管理
     * 
     * @param performance 绩效管理
     * @return 结果
     */
    @Override
    public int insertPerformance(Performance performance)
    {
        performance.setCreateTime(DateUtils.getNowDate());
        return performanceMapper.insertPerformance(performance);
    }

    /**
     * 修改绩效管理
     * 
     * @param performance 绩效管理
     * @return 结果
     */
    @Override
    public int updatePerformance(Performance performance)
    {
        performance.setUpdateTime(DateUtils.getNowDate());
        return performanceMapper.updatePerformance(performance);
    }

    /**
     * 删除绩效管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deletePerformanceByIds(String ids)
    {
        return performanceMapper.deletePerformanceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除绩效管理信息
     * 
     * @param performanceId 绩效管理ID
     * @return 结果
     */
    @Override
    public int deletePerformanceById(Long performanceId)
    {
        return performanceMapper.deletePerformanceById(performanceId);
    }
}
